package config

type ServerConfig struct {
	Name    string        `yaml:"name" json:"name"`
	Host    string        `yaml:"host" json:"host"`
	Port    int           `yaml:"port" json:"port"`
	Tags    []string      `yaml:"tags" json:"tags"`
	Chain   ChainConfig   `yaml:"chain" json:"chain"`
	Mysql   MysqlConfig   `yaml:"mysql" json:"mysql"`
	Elastic ElasticConfig `yaml:"elastic" json:"elastic"`
	Consul  ConsulConfig  `yaml:"consul" json:"consul"`
	Jaeger  JaegerConfig  `yaml:"jaeger" json:"jaeger"`
}

type ChainConfig struct {
	Deployer      string `yaml:"deployer" json:"deployer"`
	PortalProver  string `yaml:"portal_prover" json:"portal_prover"`
	TradeProver   string `yaml:"trade_prover" json:"trade_prover"`
	TradeAuditor  string `yaml:"trade_auditor" json:"trade_auditor"`
	PortalManager string `yaml:"portal_manager" json:"portal_manager"`
	TrustManager  string `yaml:"trust_manager" json:"trust_manager"`
	TradeManager  string `yaml:"trade_manager" json:"trade_manager"`
}

type MysqlConfig struct {
	Host     string `yaml:"host" json:"host"`
	Port     int    `yaml:"port" json:"port"`
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
	Database string `yaml:"database" json:"database"`
}

type ConsulConfig struct {
	Host string `yaml:"host" json:"host"`
	Port int    `yaml:"port" json:"port"`
}

type JaegerConfig struct {
	Host string `yaml:"host" json:"host"`
	Port int    `yaml:"port" json:"port"`
	Name string `yaml:"name" json:"name"`
}

type ElasticConfig struct {
	Host string `yaml:"host" json:"host"`
	Port int    `yaml:"port" json:"port"`
}

type NacosConfig struct {
	Host        string `mapstructure:"host"`
	Port        uint64 `mapstructure:"port"`
	NamespaceId string `mapstructure:"namespaceId"`
	TimeoutMs   uint64 `mapstructure:"timeoutMs"`
	LogDir      string `mapstructure:"logDir"`
	CacheDir    string `mapstructure:"cacheDir"`
	MaxSize     int    `mapstructure:"maxSize"`
	MaxBackups  int    `mapstructure:"maxBackups"`
	MaxAge      int    `mapstructure:"maxAge"`
	LogLevel    string `mapstructure:"logLevel"`
	AppName     string `mapstructure:"appName"`
	ContextPath string `mapstructure:"contextPath"`
	Username    string `mapstructure:"username"`
	Password    string `mapstructure:"password"`
	DataID      string `mapstructure:"dataId"`
	Group       string `mapstructure:"group"`
}
